#pragma once

#include "Vector3D.h"

namespace Maths
{
	class Matrix
	{
	public:
		typedef std::vector<Matrix> Vector_t;

		Matrix(Matrix& o);
		Matrix();
		Matrix(float left,float right,float bottom,float top,float zNear,float zFar);
		Matrix(float fovy, float acpect,float zNear,float zFar);
		// Set to Identity
		void Identity();
		// Set to Zero
		void Zero();
		// Makes matrix from Head Pitch Roll
		void fromHeadPitchRoll( float headDegrees, float pitchDegrees, float rollDegrees );
		// Gets Head Pitch Roll
		void toHeadPitchRoll( float &headDegrees, float &pitchDegrees, float &rollDegrees ) const;
		// Functions
		void Translate( Vector3D& translation );
		void Translate( float x, float y, float z );
		void RotateX( float angle );
		void RotateY( float angle );
		void RotateZ( float angle );
		void Scale( float x, float y, float z );
		Matrix getInvert();
		inline float& Matrix::operator()(unsigned int x, unsigned int y)
		{
			return m[y][x];
		};
		Matrix& operator=(Matrix& o);
		Matrix& operator*=(Matrix& o);
		Matrix operator*(Matrix& o);
		Vector3D operator*(Vector3D& o);
		Vector3D mvMulti(Vector3D& o, float* w = 0);
	private:
		float m[4][4];
	};
};